package com.rainy.sso.server.web;

import com.rainy.sso.client.entity.Application;
import com.rainy.sso.client.entity.TokenCache;
import com.rainy.sso.server.manager.RedisManager;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @author liuqin on 2017/12/23
 */
@Controller
@RequestMapping("sso")
public class SsoLoginController {

    @Resource
    private RedisManager redisManager;

    @RequestMapping("login")
    public String login(HttpServletRequest request){
        //获取callback
        String callback = request.getParameter("callback");
        String appId = request.getParameter("appId");
        String domain = request.getRemoteHost();
        String username = request.getRemoteHost();
        String password = request.getRemoteHost();
        String token = request.getParameter("token");
        List<TokenCache> tokenCache = (List<TokenCache>)redisManager.get("token");
        if ()
        return "login";
    }
}
